feat(startup-log): report OTLP export status#9517
Conversation
Add three boolean fields to the DATADOG TRACER CONFIGURATION startup log indicating whether the tracer exports each telemetry signal over OTLP: - otlp_traces_export_enabled (OTEL_TRACES_EXPORTER === 'otlp', excluding Test Optimization mode, which keeps test spans on the citestcycle endpoint) - otlp_metrics_export_enabled (DD_METRICS_OTEL_ENABLED) - otlp_logs_export_enabled (DD_LOGS_OTEL_ENABLED) The snake_case keys are chosen for cross-language startup-log consistency. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Overall package sizeSelf size: 7.52 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.3.2 | 124.41 kB | 440.65 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9517 +/- ##
==========================================
+ Coverage 98.39% 98.45% +0.06%
==========================================
Files 947 947
Lines 128041 128066 +25
Branches 11091 11056 -35
==========================================
+ Hits 125987 126090 +103
+ Misses 2054 1976 -78 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
BenchmarksBenchmark execution time: 2026-07-24 22:57:01 Comparing candidate commit 1ccdd76 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 2324 metrics, 34 unstable metrics.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9444363f82
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| delete process.env.OTEL_TRACES_EXPORTER | ||
| delete process.env.DD_METRICS_OTEL_ENABLED | ||
| delete process.env.DD_LOGS_OTEL_ENABLED |
There was a problem hiding this comment.
Clear all OTLP exporter env vars in the startup-log tests
In shells that already set OTEL_METRICS_EXPORTER=none, this cleanup leaves that value in place, so the new metrics case calls getConfigFresh() with DD_METRICS_OTEL_ENABLED=true but config calculation disables it again and the asserted otlp_metrics_export_enabled value is no longer true. Clear the sibling OTEL exporter vars here as well, at least OTEL_METRICS_EXPORTER, before the tests set the DD_* toggles.
AGENTS.md reference: AGENTS.md:L98-L102
Useful? React with 👍 / 👎.
…ag tests The `otlp export flags` cleanup only cleared OTEL_TRACES_EXPORTER, leaving OTEL_METRICS_EXPORTER and OTEL_LOGS_EXPORTER set. In shells that export OTEL_METRICS_EXPORTER=none, config forces DD_METRICS_OTEL_ENABLED back to false, so the metrics positive case no longer observes the enabled flag. Clear all three OTEL_*_EXPORTER selectors in the shared cleanup so the tests are deterministic regardless of the surrounding shell. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
What does this PR do?
Adds three boolean fields to the
DATADOG TRACER CONFIGURATIONstartup log that report whether the tracer exports each telemetry signal over OTLP:otlp_traces_export_enabled—truewhenOTEL_TRACES_EXPORTERisotlpand the tracer isn't running in Test Optimization mode (Test Optimization keeps test spans on the citestcycle endpoint instead of OTLP).otlp_metrics_export_enabled— reflectsDD_METRICS_OTEL_ENABLED.otlp_logs_export_enabled— reflectsDD_LOGS_OTEL_ENABLED.The startup-log spec is updated to cover the new fields, the Test Optimization case, and the default all-false state.
Motivation
Part of a cross-tracer effort to surface OTLP export status uniformly. Each dd-trace library emits the same JSON keys in its startup log, so the state reads the same way regardless of language.
Additional Notes
The values mirror the tracer's actual export behavior rather than the raw environment variables: the traces flag applies the same
!isCiVisibilityguard the exporter uses, and the metrics/logs flags read the config values the OTLP pipelines gate on.Related PRs — cross-tracer OTLP startup-log effort
CI note
The
integration-webpack (node-active / node-latest)failures are pre-existing and unrelated to this change: the webpack test fixture'snpm run buildfails resolving a transitive dependency (@ljharb/tsconfig). The same two jobs fail intermittently onmaster, and the other Node versions (oldest/maintenance) pass. Not introduced by this PR.